<%@include file="/WEB-INF/templates/configuration.jsp" %>
<%-- 
    Document   : user_profile-body
    Created on : 16-Nov-2012, 16:53:07
    Author     : Roald
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" 
           prefix="fn" %>
<%@page contentType="text/html" pageEncoding="windows-1252"%>
<!DOCTYPE html>
<%
    HttpSession session_user = request.getSession(true);
    String firstname = (String) session_user.getAttribute("user_firstname");
    int user_id = 0;
    int user_type = 0;
    if (firstname != null) {
        user_id = Integer.valueOf("" + session_user.getAttribute("user_id"));
        user_type = Integer.valueOf("" + session_user.getAttribute("user_type"));
    }

%>
<%if (user_type == 2 || user_type == 3) {
%>
<p> Edit<a href="edit?newsid=${news.newsid}" class="icon edit">edit news</a></p>
<hr/>
<%}%>
<div class="news-item left">
    <div id="date">
        <span>${fn:substring(news.newsdate,8,10)}</span>
        <span>${fn:substring(news.newsdate,5,7)}</span>
        <span>${fn:substring(news.newsdate,0,4)}</span>
    </div>
    <div class="news-content">
        <h1>${news.newstitle}</h1>

        <c:if test="${news.course.getCoursetitle() != null}">
            Posted in ${news.course.getCoursetitle()}
        </c:if>
        <hr/>
        ${news.newscontent}
    </div>
</div>

